<template>
  <div class="menu">
    <van-tabbar route v-model="active" active-color="#07c160" inactive-color="#000">
      <van-tabbar-item
        replace
        to="/index"
        :badge="getUnreadChatNum == 0 ? '' : (getUnreadChatNum > 99 ? '99+': getUnreadChatNum)"
        icon="chat-o"
      >聊天</van-tabbar-item>
      <van-tabbar-item
        replace
        to="/contact"
        :badge="getReqFriendNum == 0 ? '' : (getReqFriendNum > 99 ? '99+': getReqFriendNum)"
        icon="friends-o"
      >通讯录</van-tabbar-item>
      <van-tabbar-item replace to="/discovery" :dot="dot" icon="browsing-history-o">发现</van-tabbar-item>
      <van-tabbar-item replace to="/setting" icon="setting-o">设置</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "Menu",
  data() {
    return {
      active: 0,
      dot: true
    };
  },
  methods: {},
  computed: {
    ...mapGetters(["getReqFriendNum", "getUnreadChatNum"])
  }
};
</script>

<style lang="scss" scoped>
.menu {
  .van-tabbar {
    background-color: #f8f8f9;
  }
}
</style>